package cn.tianyigps.tianyigpsapiv2.oauth2.entity;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * Created with IDEA
 * author:guibin.cui
 * Date:2018/12/12
 * Time:13:31
 */
@Getter
@Setter
public class FortUserDetails implements UserDetails {

    private String client_id;
    private String client_secret;
    private String username;
    private String password;
    private  boolean accountNonExpired;
    private  boolean accountNonLocked;
    private  boolean credentialsNonExpired;
    private  boolean enabled;
    private List<GrantedAuthority> authorities;
//    private String access_token_validity;
//    private String refresh_token_validity;
//    private String additional_information;
//    private String autoapprove;

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
